import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SheetFormCheckVO, SheetFormCheckForm, SheetFormCheckQuery } from '@/api/sheet/sheetFormCheck/types';

/**
 * 查询单校验列表
 * @param query
 * @returns {*}
 */

export const listSheetFormCheck = (query?: SheetFormCheckQuery): AxiosPromise<SheetFormCheckVO[]> => {
  return request({
    url: '/system/sheetFormCheck/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询单校验详细
 * @param sheetFormCheckId
 */
export const getSheetFormCheck = (sheetFormCheckId: string | number): AxiosPromise<SheetFormCheckVO> => {
  return request({
    url: '/system/sheetFormCheck/' + sheetFormCheckId,
    method: 'get'
  });
};

/**
 * 新增单校验
 * @param data
 */
export const addSheetFormCheck = (data: SheetFormCheckForm) => {
  return request({
    url: '/system/sheetFormCheck',
    method: 'post',
    data: data
  });
};

/**
 * 修改单校验
 * @param data
 */
export const updateSheetFormCheck = (data: SheetFormCheckForm) => {
  return request({
    url: '/system/sheetFormCheck',
    method: 'put',
    data: data
  });
};

/**
 * 删除单校验
 * @param sheetFormCheckId
 */
export const delSheetFormCheck = (sheetFormCheckId: string | number | Array<string | number>) => {
  return request({
    url: '/system/sheetFormCheck/' + sheetFormCheckId,
    method: 'delete'
  });
};
